1. Field of the Invention
The present invention relates to a method and apparatus for encoding and decoding in an inter mode, and more particularly, to a method and apparatus for encoding and decoding in an inter mode based on multiple scanning in which an encoding and decoding order is set according to whether references for motion estimation can be used as a reference for encoding/decoding.
2. Description of the Related Art
Recently, codecs of Moving Picture Experts Group (MPEG)-2, MPEG-4, and H.263 use discrete cosine transform (DCT) conversion as a reference in an inter mode.
In an inter mode of H.264, a top macroblock (MB) and/or a left MB is/are used as a reference.
Referring to FIG. 1, it can be seen that an encoding/decoding order in MPEG-2, MPEG-4, H.263, and H.264 is from left to right, and from top to bottom.
FIG. 2 is a view of an encoding/decoding order in an inter mode of MPEG-2, MPEG-4, and H.263.
First, the encoding order of MPEG-2, MPEG-4, and H.263 is as follows:                (1) A current block A is obtained.        (2) Motion is estimated from a previously decoded image to obtain an estimation block.        (3) An interpolation matrix C is obtained from the estimation block.        (4) After calculating the difference between the block A and the interpolation matrix C, DCT conversion is performed: DCT(A-C)        (5) Quantization is performed: Matrix B=Quantization (DCT(A-C))        (6) Coefficients of matrix B (i.e., DCT coefficients) are zigzag scanned, and variable length code (VLC) encoding is performed.        
The decoding order of MPEG-2, MPEG-4, and H.263 is as follows:                (1) A Matrix A is obtained by VLC decoding and zigzag scanning.        (2) Dequantization is performed: Matrix B=Dequantization(A)        (3) Inverse DCT (IDCT) is performed: IDCT(B)        (4) Motion estimation is performed to obtain an interpolation matrix C from the previous decoded reference frame.        (5) A decoded 8×8 block is obtained by adding the result of IDCT and the obtained interpolation matrix C: IDCT(B)+C.        
FIG. 3 is a view of an encoding/decoding order in an inter mode of H.264 switching I (SI) pictures.
In H.264 SI, the inter mode is based on DCT conversion of the difference of 4×4 (or 16×16) blocks and spatial estimation of itself. First, the encoding order of H.264 is as follows:                (1) A current block A is obtained.        (2) Motion estimation is performed using decoded MBs inside a current frame.        (3) An interpolation matrix C (reference) is obtained from the motion estimation block.        (4) A difference between block A and interpolation matrix C is DCT converted: DCT(A-C)        (5) Quantization is performed: B=Quantization (DCT(A-C))        (6) Matrix B is zigzag scanned, and VLC encoding is performed.        
The decoding order of H.264 Si is as follows:                (1) Matrix A is obtained by VLC decoding and zigzag scanning.        (2) Dequantization is performed: B=Dequantization(A)        (3) IDCT is performed: IDCT(B)        (4) Motion estimation is performed to obtain an interpolation matrix C (reference) from a previously decoded reference frame.        
(5) A decoded 8×8 block is obtained by adding a result of IDCT and the obtained interpolation matrix C: IDCT(B)+C.
As seen with reference to FIGS. 2 and 3, the number of modes for basic encoding and decoding unit is limited in the conventional art.
In the case of an inter mode, information can be obtained from only a previously decoded frame or decoded MBs inside the current frame (such decoded MBs are always on the top or left of the current frame) as a reference for motion estimation, and thus, spatial relationship is strictly limited.
Therefore, if a MB has an error (caused by an encoder or transmission) included therein, the left MB in such slice or the frame is also lost and a low peak signal-to-noise occurs due to error transmission.